import { Cascader, Button } from 'antd'
import { useContext } from 'react'
import { reportReviewContext } from '../../_context'
import IconSvg from '@/components/IconSvg'
import styles from './index.module.less'

export default () => {
  const { task, handleTaskChange, exportReview, quarterData } = useContext(reportReviewContext)

  return (
    <div className={styles.search}>
      <Cascader
        value={task}
        style={{ width: 200, marginRight: '16px' }}
        onChange={(e) => handleTaskChange(e)}
        options={quarterData}
        placeholder={'请选择任务'}
        displayRender={(value) => value.join('')}
        allowClear={false}
      />
      <Button
        onClick={() => exportReview()}
        className={styles.exportbtn}
        type='primary'
        ghost
        icon={<IconSvg name='export' />}
      >
        导出
      </Button>
    </div>
  )
}
